package cn.com.nes.mybatis.agent.ope.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * <p>
 * 设备协议查询指令表
 * </p>
 *
 * @author nes
 * @since 2023-02-28
 */
@TableName("is_protocol_query_command")
public class IsProtocolQueryCommand extends Model<IsProtocolQueryCommand> {

    private static final long serialVersionUID = 1L;

    /**
     * 自增id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 查询指令id
     */
    @TableField("query_command_id")
    private String queryCommandId;
    /**
     * 设备协议id
     */
    @TableField("protocol_id")
    private String protocolId;
    /**
     * 查询指令标题
     */
    private String name;
    /**
     * 指令
     */
    private String command;
    /**
     * 返回数据的头部
     */
    @TableField("response_header")
    private String responseHeader;
    /**
     * 返回数据的长度
     */
    @TableField("response_length")
    private Integer responseLength;
    /**
     * 组号
     */
    @TableField("group_number")
    private Integer groupNumber;
    /**
     * 逻辑删除  1 表示删除，0 表示未删除
     */
    @TableField("is_deleted")
    private Integer isDeleted;
    /**
     * 创建人
     */
    @TableField("cr_oper")
    private String crOper;
    /**
     * 创建时间
     */
    @TableField("gmt_create")
    private Date gmtCreate;
    /**
     * 修改人
     */
    @TableField("up_oper")
    private String upOper;
    /**
     * 修改时间
     */
    @TableField("gmt_modified")
    private Date gmtModified;
    /**
     * 数据版本号  当前时间戳
     */
    private Long version;
    /**
     * 起始寄存器地址
     */
    @TableField("start_register_address")
    private String startRegisterAddress;
    /**
     * 寄存器地址类型：0：bit类型；1：十六进制；2：十进制
     */
    @TableField("register_type")
    private Integer registerType;
    /**
     * 采集周期, 单位: 秒, 默认5分钟
     */
    @TableField("collect_cycle")
    private Integer collectCycle;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getQueryCommandId() {
        return queryCommandId;
    }

    public void setQueryCommandId(String queryCommandId) {
        this.queryCommandId = queryCommandId;
    }

    public String getProtocolId() {
        return protocolId;
    }

    public void setProtocolId(String protocolId) {
        this.protocolId = protocolId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCommand() {
        return command;
    }

    public void setCommand(String command) {
        this.command = command;
    }

    public String getResponseHeader() {
        return responseHeader;
    }

    public void setResponseHeader(String responseHeader) {
        this.responseHeader = responseHeader;
    }

    public Integer getResponseLength() {
        return responseLength;
    }

    public void setResponseLength(Integer responseLength) {
        this.responseLength = responseLength;
    }

    public Integer getGroupNumber() {
        return groupNumber;
    }

    public void setGroupNumber(Integer groupNumber) {
        this.groupNumber = groupNumber;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    public String getCrOper() {
        return crOper;
    }

    public void setCrOper(String crOper) {
        this.crOper = crOper;
    }

    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public String getUpOper() {
        return upOper;
    }

    public void setUpOper(String upOper) {
        this.upOper = upOper;
    }

    public Date getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(Date gmtModified) {
        this.gmtModified = gmtModified;
    }

    public Long getVersion() {
        return version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }

    public String getStartRegisterAddress() {
        return startRegisterAddress;
    }

    public void setStartRegisterAddress(String startRegisterAddress) {
        this.startRegisterAddress = startRegisterAddress;
    }

    public Integer getRegisterType() {
        return registerType;
    }

    public void setRegisterType(Integer registerType) {
        this.registerType = registerType;
    }

    public Integer getCollectCycle() {
        return collectCycle;
    }

    public void setCollectCycle(Integer collectCycle) {
        this.collectCycle = collectCycle;
    }

    public static final String ID = "id";

    public static final String QUERY_COMMAND_ID = "query_command_id";

    public static final String PROTOCOL_ID = "protocol_id";

    public static final String NAME = "name";

    public static final String COMMAND = "command";

    public static final String RESPONSE_HEADER = "response_header";

    public static final String RESPONSE_LENGTH = "response_length";

    public static final String GROUP_NUMBER = "group_number";

    public static final String IS_DELETED = "is_deleted";

    public static final String CR_OPER = "cr_oper";

    public static final String GMT_CREATE = "gmt_create";

    public static final String UP_OPER = "up_oper";

    public static final String GMT_MODIFIED = "gmt_modified";

    public static final String VERSION = "version";

    public static final String START_REGISTER_ADDRESS = "start_register_address";

    public static final String REGISTER_TYPE = "register_type";

    public static final String COLLECT_CYCLE = "collect_cycle";

    @Override
    public Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "IsProtocolQueryCommand{" +
        ", id=" + id +
        ", queryCommandId=" + queryCommandId +
        ", protocolId=" + protocolId +
        ", name=" + name +
        ", command=" + command +
        ", responseHeader=" + responseHeader +
        ", responseLength=" + responseLength +
        ", groupNumber=" + groupNumber +
        ", isDeleted=" + isDeleted +
        ", crOper=" + crOper +
        ", gmtCreate=" + gmtCreate +
        ", upOper=" + upOper +
        ", gmtModified=" + gmtModified +
        ", version=" + version +
        ", startRegisterAddress=" + startRegisterAddress +
        ", registerType=" + registerType +
        ", collectCycle=" + collectCycle +
        "}";
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(this.queryCommandId);
    }
}
